const Koa = require('koa')
const app = new Koa()

const middleware1 = async function(ctx, next){
    console.log('this is a middleware1 start')
    next()
    console.log('this is a middleware1 end')
}

app.use(middleware1)

const middleware2 = async function(ctx, next){
    console.log('this is a middleware2 start')
    next()
    console.log('this is a middleware2 end')
}

app.use(middleware1)
app.use(middleware2)
console.log('\n\n\n')

app.listen(3000)